import React from 'react'
import { Link, Control } from 'react-keeper'
import 'weui';
import fangzi from './../../assets/icon/房子.png';
import { ButtonArea,Panel,PanelHeader,PanelBody,Page,
  Button,
  CellsTitle,
  CellsTips,
  Cell,
  CellHeader,
  CellBody,
  CellFooter,
  Form,
  FormCell,
  Icon,
  Input,
  Label,
  TextArea,
  Switch,
  Radio,
  Checkbox,
  Select,
  VCode,Flex,
  FlexItem,
  MediaBox,
  MediaBoxHeader,
  MediaBoxBody,
  MediaBoxTitle,
  MediaBoxDescription,
  MediaBoxInfo,
  MediaBoxInfoMeta,
  Agreement,
  Toptips
} from  'react-weui/build/packages';
const appMsgIcon = <img
  src=""/>



export default class RzInfo extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
    }
    this.mypreview = this.mypreview.bind(this);
  }

  mypreview() {
    Control.go('/mypreview');
  }

  shouldComponentUpdate(nextProps = {}, nextState = {}) {
    return true;
  }

  render() {
    return (

      <Panel className="head-panel">
        <PanelHeader>
          <div className="title-bg"/>
          参建工程
        </PanelHeader>
        <PanelBody>
          <Flex>
            <FlexItem >
              {
                this.props.rzls.map((item, index) => {
                  return <RzInfo rz={item} key={index}/>
                })
              }
            </FlexItem>
          </Flex>
        </PanelBody>
      </Panel>
    )
  }
}

RzInfo.propTypes = {
  rzls: React.PropTypes.object.isRequired,
  imgls: React.PropTypes.object.isRequired
}

class RzItem extends React.Component {
  constructor(props) {
    super(props);
    this.mypreview = this.mypreview.bind(this);
  }

  mypreview() {
    Control.go('/myinfo/engview',this.props.eng);
  }

  render() {
    return (

      <Cell >
        <CellHeader  access link onClick={this.mypreview} style={{position: 'relative', marginRight: '10px'}}>
          <img src={fangzi} alt="" o style={{display: `block`, width: `20px`, marginRight: `5px`}}/>
        </CellHeader>
        <CellBody>
          <p>{this.props.rz.id}  </p>

          <p style={{fontSize: '13px', color: '#888888'}}>  { this.props.rz.id }</p>
          <p style={{fontSize: '13px', color: '#888888'}}>{ this.props.zr.id}</p>
        </CellBody>
      </Cell>

    )
  }
}
RzItem.propTypes = {
  rz: React.PropTypes.object.isRequired
}



